package com.lzw.app;

import java.io.Serializable;

/**
 * 注册中心实例对象
 * @author LZW
 */
public class Instance implements Serializable {
    public static final long serialVersionUID = 2020L;
    //应用名
    private String name;
    //id=ip:name:port
    private String id;
    private String url;
    private String host;
    private int port;

    //上一次ping的毫秒数
    private long lastPing;
    //服务无效的判断时长
    private int invalidateSecond;

    public long getLastPing() {
        return lastPing;
    }

    public void setLastPing(long lastPing) {
        this.lastPing = lastPing;
    }

    public int getInvalidateSecond() {
        return invalidateSecond;
    }

    public void setInvalidateSecond(int invalidateSecond) {
        this.invalidateSecond = invalidateSecond;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public String toString() {
        return "Instance{" +
                "name='" + name + '\'' +
                ", id='" + id + '\'' +
                ", url='" + url + '\'' +
                ", host='" + host + '\'' +
                ", port=" + port +
                ", lastPing=" + lastPing +
                ", invalidateSecond=" + invalidateSecond +
                '}';
    }
}
